﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TinyOsMessageForwarder
{
    public class DebugMessage : TinyOS2Message
    {
        //public static int AM_TYPE = 16;
        public DebugMessage(TinyOS2Message msg): base(msg.RawMessage)
        {
        }

        public int csleft
        {
            get
            {
                return ReadUInt16(7);
            }
        }
        
        public int csright
        {
            get
            {
                return ReadUInt16(9);
            }
        }

        public int Ileft
        {
            get
            {
                return ReadInt16(11);
            }
        }

        public int Iright
        {
            get
            {
                return ReadInt16(13);
            }
        }

        public int PWMleft
        {
            get
            {
                return ReadInt16(15);
            }
        }

        public int PWMright
        {
            get
            {
                return ReadInt16(17);
            }
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("DebugMessage(");
            sb.Append("cl= "+csleft+", Il= "+Ileft+", PWMl= "+PWMleft+"; "); 
            sb.Append("cr= "+csright+", Ir= "+Iright+", PWMr= "+PWMright);
            sb.AppendLine(")");
            return sb.ToString();
        }
    }
}
